package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.ProductDao;
import com.cn.wanxi.dao.impl.ProductImpl;
import com.cn.wanxi.model.PageModel;
import com.cn.wanxi.model.ProductModel;
import com.cn.wanxi.service.IProductService;

import java.util.List;

public class ProductServiceImpl implements IProductService {
    @Override
    public int add(ProductModel productModel) {
        ProductDao productDao=new ProductImpl();

        return productDao.add(productModel);
    }

    @Override
    public List<ProductModel> findAll(ProductModel productModel) {
        ProductDao productDao=new ProductImpl();
        return productDao.findAll(productModel);
    }

    @Override
    public ProductModel findById(Integer id) {
        ProductDao productDao=new ProductImpl();
        return productDao.findById(id);
    }

    @Override
    public int getCount(ProductModel productModel) {
        ProductDao productDao=new ProductImpl();
        return productDao.getCount(productModel);
    }
}
